package com.itheima.mystream;

import java.util.*;
import java.util.stream.Stream;

public class Demo1 {
    public static void main(String[] args) {
        //运用Collection来获取
        List<String> list = new ArrayList<>();
        Stream<String> stream = list.stream();

        //用Map间接创建
        Map<String,String> map = new HashMap<>();
        //调用键值对三种
        Set<String> keys = map.keySet();
        Stream<String> stream1 = keys.stream();
        //利用值
        Collection<String> values = map.values();
        Stream<String> stream2 = values.stream();
        //利用键值对
        Set<Map.Entry<String, String>> entries = map.entrySet();
        Stream<Map.Entry<String, String>> stream3 = entries.stream();


        //利用数组
       String[] strArr = {"aa","bb","cc"};
        Stream<String> stream4 = Arrays.stream(strArr);
         //同种数据类型获取
        Stream<String> h = Stream.of("h", "s", "f");
        Stream<Integer> integerStream = Stream.of(1, 2, 3);

    }
}
